<?php
// echo 1111;
$uid=$_GET['uid'];
$link = mysqli_connect("localhost","root","root","2113");
$sql="SELECT p.pname,c.num,p.img,p.price,p.id FROM carts AS c JOIN products AS p ON c.pid=p.id WHERE c.uid=$uid";
// echo $sql; die;
$res=mysqli_query($link,$sql);
$arr=[];
while($one=mysqli_fetch_assoc($res)){
    $arr[]=$one;
}
echo json_encode($arr);

?>